package com.skivingcloud.admin.sys.service.impl;

import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.skivingcloud.admin.sys.entity.SysUserStation;
import com.skivingcloud.admin.sys.mapper.SysUserStationMapper;
import com.skivingcloud.admin.sys.service.SysUserStationService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *  服务层实现。
 *
 * @author skivingcloud
 * @since 2023-08-28
 */
@Service
public class SysUserStationServiceImpl extends ServiceImpl<SysUserStationMapper, SysUserStation> implements SysUserStationService {
    
    /**
     * 根据用户id获取用户岗位关系
     *
     * @param id 用户id
     * @return 关系结果
     */
    @Override
    public List<SysUserStation> listByUserId(String id){
        QueryWrapper queryWrapper = QueryWrapper.create().where(SysUserStation::getUserId).eq(id);
        return this.list(queryWrapper);
    }
}
